Data 601 Project: Economic Productivity of Alberta

By Team Brown Chang Min (Rudy Brown, Yi-Chi Chang, Aung Khant Min)

Introduction

The economic health of a province or country has a significant impact on the quality of life and the lifestyle of its constituents. Our goal is to identify trends and distinguishing aspects in Alberta’s economy to evaluate how significant economic indicators for Alberta have changed over time and make note when the trends in these indicators stand out within Canada. We’ve collected and plotted consumer cost and population information for Alberta and compared it with other provincial economies. For Alberta and other provincial economies, we’ve assessed the productivity of the economies on a per person basis and used the data that we’ve gathered to assess the change in inflation-adjusted economic productivity.

The two market indicators we have be utilized in this study is the Gross Domestic Product (GDP) and the Consumer Price Index (CPI). The GDP is the total value (in canadian dollars) of all goods produced and services rendered in a specific area. The CPI is a measure of changes in a consumer's purchasing power and is obtained by comparing the cost of goods and services purchased (as an index) over time and it's a good measure of the intrinsic value of the Canadian dollar. We’ve collected data for GDP and CPI changes for Alberta and other provincial economies in Canada for visualizations about the two economies. The inflation-adjusted GDP has been evaluated by plotting (GDP/CPI) against time and all per capita metrics have been evaluated by plotting (metric/population) against time.

The guiding questions we will be investigating are:

  1. How has Alberta performed compared to other provinces and Canada as a whole in CPI and GDP?
  2. What industrial sectors dominate the Albertan economy?
  3. What economic events have impacted the Albertan economy?
  4. How has Alberta’s population changed over time compared to other provinces?
  5. How has Alberta’s GDP per capita changed over time?
  6. How has consumer purchasing power changed over time in Alberta and other selected provinces? (GDP per capita/CPI)

Datasets

Within this project, CPI and GDP have been used to measure the economic health of the different economies in Canada. For the calculation of GDP per capita, population data of each province was also extracted from the dataset. The structured csv data are publicly available through the website of Statistics Canada (Monthly GDP) and Alberta economic dashboard (Annual GDP, Monthly CPI Quarterly population).

All of the datasets used in this project are time series format and we will be using date column as a major key for data merging. In the annual GDP data from alberta economic dash board, the GDP data is categorized by province and industry and by how the GDP is calculated (chained 2012 dollars or current dollars). To avoid the effect of inflation and currency fluctuation, we have used chained 2012 dollars for the analysis on GDP. The structure of monthly GDP data from statistic Canada is similar to the annual GDP data but without the province column. The Monthly CPI data from alberta economic dashboard is categorized by commodity(food, good, transportation...etc). The quarterly population data is categorized by province.

The period that will be used in this project is 2000~2022.06. Monthly data is preferred over annual so that we have enough data points for the visualization. However, we are unable to get the province level GDP data, so we will have to use Annual provinces GDP data and monthly Canada GDP data to simulate monthly GDP for each province during the data cleaning process.

The following are columns used in this analysis:

  1. Annual GDP data (statistic Canada) : Date, Province, GDP, Industry
  2. Monthly GDP data (statistic Canada) : Date, GDP, Industry
  3. Annual GDP data (Alberta economic dashboard): Date, GDP, Industry
  4. Monthly CPI (Alberta economic dashboard): Date, Province, CPI
  5. Quarterly population (Alberta economic dashboard): Date, Province, Population

Accessing the Data

All the required Data can be accessed here : https://drive.google.com/drive/folders/1zR7wQ-EnlCTgU1Tln4i0_Ynzl7UNgu5Q

Data Wrangling

Reading data

Cleaning GDP

Step 1 Calculate weight of contribution of each province to Canada's GDP

To simulate monthly GDP data, we will have to first start calculating each province’s weight of contribution to Canada’s GDP, which is simply the ratio of a province’s annual GDP over total GDP of Canada. So first we start filtering out the necessary column we need. We filter out “all industry” and “chained (2012) dollars”. Next, we unstack the data to move province to column index. With this data structure we will be able to easily calculate the weight by simply divides single value over total value.

$$ Weight = \frac{(Annual \ GDP \ of \ province)}{(Annual \ Total \ GDP \ of \ Canada)} \\ Simulated \ Monthly \ Province \ GDP = (Weight) \times (Monthly \ Total \ GDP \ of \ Canada) $$

Step 2 Left join "Weight" data to "Canadian monthly GDP" data and multiply the weight and GDP values

Next step, we merge the weight data frame to Canada monthly GDP data using Year as a key. After merging, we will be able to calculate the simulated GDP by simply multiply the weight and monthly total GDP of Canada.

Step 3 Growth rate calculation (GDP)

As GDP growth rate is needed for the analysis, we simply apply percent change function to get the growth rate (As GDP data are all positive, we won’t need to worried about the restriction of percent change function on negative data)

Cleaning CPI

The CPI data is relatively clean. We will not be using “commodity” columns in this analysis (only to filter out "All items"). We also calculate the growth rate of the CPI with percent change function as well.

Step 1 filter

Step 2 Growth rate calculation

Export data

Cleaning population to generate GDP per Capita

As population data is quarterly based, we will have to label the data with year and season to be able to use It as a key to right join with the monthly GDP data that we just simulated.We do the same label on the simulated GDP data and use it as a key to left join on the population data with labeled.With GDP data and population data at same data frame, we will be able to generate GDP per capita by dividing province GDP on province population.

Generate GDP per capita

Adding CPI and calculate Purchasing power

Last, we join all the cleaned data frame we generate to one data frame for the convenience of analysis.

Visualizations

Our filtering and line-graph plotting functions

The code chunk below consists of four functions: filtering, dffiltering, autolineplotter and dfautolineplotter.

The first function is called filtering and it accepts a substring named "sub" and data to filter from. The substring is set to "GDP(Million)" if no substring is passed and data is set to our aggregate data Alberta_GDP_percap_cpi if no data is passed in. The @return parameter is a filtered version of the data with the date ('When') column as index and the case specific data columns that matches the substring passed in.

The second function is called dffiltering and it does the same thing as filtering but it does the filtering based on quarters instead of each date. (@param) The substring is set to "GDP(Million)" if no substring is passed and data is set to our aggregate data with year and quarters for date 'df' if no data is passed in. The @return parameter is a filtered version of the data with the date ('Year_Season') column as index and the case specific data columns that matches the substring passed in.

The third function is called Autolineplotter and it takes in the case specific dataset and plots a line graph using pixel express. The paramters that needs to be passed in are the case specific dataset (output from filtering), the title of the graph and the value of the y_label. There is no @return parameter because this function just plots.

Guiding Questions:

Question 1: How has Alberta performed compared to other provinces and Canada as a whole in CPI and GDP?

For GDP:

For CPI:

Plotly lineplot of Provincial GDPs timeseries

Ontario has the largest GDP and Alberta is the third largest GDP.

Seaborn lineplot of Provincial GDP growth rates

Alberta has the largest distribution in GDP growth compared to Ontario and British Columbia.

Violin plot of provincial GDP distributions

Violin plot to display distributions of provincial GDPs

Choropleth of 2021 Provincial GDP

In 2021, the largest economies in Canada were Ontario, Quebec and Alberta in that order. The color of the province on the geo plot is changed based on the province's GDP.

Plotly lineplot of Provincial CPI timeseries

The line plot shows that Alberta has the highest CPI with Saskatchewan and Ontario as second and third.

Seaborn lineplot of Provincial CPI growth rates

This plot shows the growth rates of the three provinces in terms of CPI. Alberta has the highest variance.

Choropleth of 2021 Provincial CPI

In 2021, the largest CPI index in Canada were Alberta, Saskatchewan and Ontario in that order. The color of the province on the geo plot is changed based on the province's CPI index.

Question 2: Which provinces dominate the Canadian Economy and what industrial sectors dominate the Albertan economy?

Q3 What economic events have impacted the Albertan economy?

Alberta Stacked Bargaph of GDP across time

Below is a bar graph of Alberta's GDP across time. Across each year, the height indicates the value of GDP and the stacked colors indicate the amount that comes from each industry. We can roughly see that Mining and Real Estate makes up a good percent of GDP.

Alberta Percentage of Industry contributions across year

Since the starting point of our dataset: 1997, the mining industry dominate Alberta's economy. Across the years, till 2010, the percentage that the mining industry falls off since the other industries starts to grow. Post 2010, the mining industry goes back on an uptrend. If we look closely, the construction seems to peak at 2014 and stabilizes at around 6% of the GDP.

Interactive Barplot showing Alberta's industry contribution to GDP from 1997 to 2021

Plotted below is an interactive barplot that goes from 1997 to 2021. Move the slider to change the year that the graph corresponds to.

Question 4: How has Alberta’s population changed over time compared to other provinces?

Line plot of Alberta's population across time

Line plot of each province's population across time

Question 5: How has Alberta’s GDP per capita changed over time?

Violin plot of distributions of annual provincial GDP per capita

This violin plot displays the distribution of annual provincial GDP per capitas which is useful to compare the spread of GDPs per capita by province. Below is the visualization.

Line plot of Provincial GDP per capita time series

This line plot displays the provincial GDP per capitas as time series. Annotated are the time frames of economic crises. Below is the visualization.

Question 6: How consumer purchasing power changed over time? (GDP per capita/CPI)

Conclusion

Over the time period of our study Alberta has consistently been the 3rd largest economy of the 5 selected provinces but has the largest GDP/capita. Alberta’s annual GDP is similar to that of Quebec and BC. Additionally, we found that each studied province had a similar trend in CPI but the cost of consumer goods in Alberta has risen faster than any other provinces.

We found that the natural resource extraction sector is the largest in Alberta followed by the real estate, rental and leasing sector and then construction. We found that oil and gas comprises about 30% of Alberta’s GDP.

Each province experienced gradual growth of GDP between the year 2000 and 2008, but the subprime mortgage crisis of 2008 hurt the GDP of every province. However Alberta’s GDP was impacted more than other provincial GDPs during the 2008 crisis. Alberta's GDP performed well compared to other provinces between 2010 and 2015, but the oil price crash of 2015 had a strong negative effect on Alberta that the other provinces did not experience. Additionally, we found that every province had a similar trend in CPI but the cost of consumer goods in Alberta has risen faster than any other provinces.

We found that Alberta has consistently ranked 4th in population out of the 5 provinces investigated and Alberta’s relative growth roughly matches the relative growth of British Columbia.

Alberta has consistently had the highest GDP per capita in Canada and Alberta’s GDP per capita is more strongly affected by economic downturns than other provinces. Each provincial GDP reaction to economic downturn can easily be seen in the GDP per Capita plot. We also found that Alberta has a wider distribution of GDP per capita than other provinces.

We have also investigated ‘purchasing power’ which is the ratio of GDP per capita to CPI. This reflects the purchasing power of an individual in the economy. We found that the value of purchasing power to be decreasing for each province. Alberta’s purchasing power has decreased more than any other province which may have implications for the lifestyle of Albertans.

We have shown that Alberta is the strongest economy in Canada on a per person basis, however we have also seen that the distribution of Alberta’s annual GDP/capita is more widely distributed than other provinces which may indicate that Alberta is more sensitive to economic events.

Some possible next steps of this study would be to investigate the effect of the economic downturns on specific sectors in the Albertan economy and to quantify the difference in the effect of the downturns on the provincial economies. The purchasing power metric we used in this study is not founded on solid economic theory,so we would also like to apply the appropriate economic theories to make the purchasing power a quantifiable indicator.

Reference